package com.zhou.bpm.enmu;

/**
 * @Author: zhoujinchuan
 * @Description: TODO（请添加描述）
 * @CreateTime: 2023/10/25 14:36
 */
public enum InstanceStatusEnum {
    //流程状态(1-申请人发起,2-审批中,3-已完成,4-已撤回,5-已作废)
    INITIATED_BY_THE_APPLICANT("1", "流程人发起"),
    UNDER_APPROVAL("2", "审批中"),
    COMPLETED("3", "已完成"),
    WITHDRAWN("4", "已撤回"),
    VOIDED("5", "已作废");

    private String code;

    private String label;

    InstanceStatusEnum(String code, String label) {
        this.code = code;
        this.label = label;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static String getLabelByCode(String code) {
        for (InstanceStatusEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value.getLabel();
            }
        }
        return "";
    }
}
